﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SCPutils;
using System.Data;

namespace SPC.Classes
{
    class Person : BasicObject
    {
        private static string PERSON_ID = "id";
        private static string PERSON_ATTRIB_NAME = Properties.Settings.Default.PERSON_ATTRIB_NAME;
        private static string PERSON_ATTRIB_ADDRESS = Properties.Settings.Default.PERSON_ATTRIB_ADDRESS;
        

        private List<Penalty> listPenalties;
        
        public Person()
        {
            listPenalties = new List<Penalty>();
        }

        public Person(DataRow dataRow)
        {
            this.setID(dataRow["id"].ToString());
            this.setName(dataRow[PERSON_ATTRIB_NAME].ToString());
            this.setAddress(dataRow[PERSON_ATTRIB_ADDRESS].ToString());

            listPenalties =  new List<Penalty>();
        }

        public string getID()
        {
            return this.dictData[PERSON_ID];
        }
        public void setID(string strValue)
        {
            this.dictData[PERSON_ID] = Utils.Data._sql(strValue);
        }

        public string getName()
        {
            return this.dictData[PERSON_ATTRIB_NAME];
        }
        public void setName(string strValue)
        {
            this.dictData[PERSON_ATTRIB_NAME] = Utils.Data._sql(strValue);
        }

        public string getAddress()
        {
            return this.dictData[PERSON_ATTRIB_ADDRESS];
        }
        public void setAddress(string strValue)
        {
            this.dictData[PERSON_ATTRIB_ADDRESS] = Utils.Data._sql(strValue);
        }



        public List<Penalty> getPenalties()
        {
            return this.listPenalties;
        }
        public void setPenalties(List<Penalty> listPenalties)
        {
            this.listPenalties = listPenalties;
        }

    }
}
